import { ApiProperty } from '@nestjs/swagger';
import { Post } from '@prisma/client';
export class PostData {
  @ApiProperty({ description: '标题', example: 'prisma', uniqueItems: true })
  title: string
  @ApiProperty({ description: '内容', example: 'example projects' })
  content?: string
  @ApiProperty({ description: '发布状态', example: false })
  publish: boolean
  @ApiProperty({ description: '作者邮箱', example: '12345@qq.com' })
  authorEmail: string
}

export class UpdatePost {
  @ApiProperty({ description: '要更新帖子的id', example: '1' })
  id: number
  @ApiProperty({ description: '标题', example: '八荣八耻' })
  title: string
  @ApiProperty({ description: '内容', example: '以热爱祖国为荣 以危害祖国为耻 以服务人民为荣 以背离人民为耻 以崇尚科学为荣 以愚昧无知为耻' })
  content: string
  @ApiProperty({ description: '发布状态', example: '1' })
  publish: number
}

export class QueryPost {
  @ApiProperty({ description: '页码', example: '1', required: false })
  page?: number
  @ApiProperty({ description: '每页条数', example: '5', required: false })
  pageSize?: number
}

export class PostDto {
  count: number
  data: Post[]
}